﻿using System;

using Storyteller.Framework.Math;

namespace Storyteller.Framework.Graphics.Particles.EmitModifiers
{
	public class RandomVelocityEmitModifier : ParticleEmitModifier
	{
		public Vector2 MinimumVelocity { get; set; }
		public Vector2 MaximumVelocity { get; set; }

		public RandomVelocityEmitModifier()
		{
			random = RandomUtil.Random;
		}

		public override void Process(Particle[] particles, int offset, int count)
		{
			for (int i = 0; i < count; i++)
			{
				particles[i + offset].Velocity = random.NextVector2(MinimumVelocity, MaximumVelocity);
			}
		}

		Random random;
	}
}
